{% extends 'index.html' %}
{% load static %}
{% block mycss %}
    <script type="text/javascript" src="{% static 'js/echarts/jquery-3.2.1.js' %}"></script>
    <script type="text/javascript" src="{% static 'js/echarts/echarts.js' %}"></script>
        <script type="text/javascript" src="{% static 'js/datashow.js' %}"></script>

{% endblock %}
{% block title %}
    <span class="navbar-page-title">知识图谱服务接口 - 知识检索服务</span>
{% endblock %}
{% block content %}


    <div class="container-fluid">

        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                        <div class="row">
                            <div class="col-xs-4"><input type="text" placeholder="请输入查询节点" id="node_name"
                                                         class="form-control my-input"></div>
                            <div class="col-xs-2">
                                <button class='btn btn-primary my-btn' type="submit" id="node_serach">查询 </button>
                            </div>
                        </div>


                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">

                        <div id="main" style="width: 100%;height: calc(100vh - 280px)"></div>

                    </div>
                </div>
            </div>
        </div>
    </div>


{% endblock %}
{% block myjs %}
    <script type="text/javascript">
        {#document.getElementById("zstpfwjk").style.display = 'block';#}
        {#document.getElementById("zsjsfw").style.backgroundColor = 'rgba(30,21,21,0.44)';#}


        $('#node_serach').click(function () {
            var node_name = $('#node_name').val();


            var formdata = new FormData();
            formdata.append("node_name", node_name);


            $.ajax({
                url: '{% url 'node_analysis' %}',
                type: 'POST',
                async: false,
                data: formdata,
                processData: false, // 使数据不做处理
                contentType: false, // 不要设置Content-Type请求头
                success: function (data) {
                    {#todo 执行函数#}
                    atlas(data.data.nodes, data.data.edges,'main')
                },
                error: function (response) {

                }
            });
        })
    </script>
    <script type="text/javascript">

    </script>
{% endblock %}
